import request from '@/utils/request'

// 查询学员列表
export function listRoster(query) {
  return request({
    url: '/student/roster/list',
    method: 'get',
    params: query
  })
}

// 查询学员详细
export function getRoster(id) {
  return request({
    url: '/student/roster/' + id,
    method: 'get'
  })
}

// 新增学员
export function addRoster(data) {
  return request({
    url: '/student/roster',
    method: 'post',
    data: data
  })
}

// 修改学员
export function updateRoster(data) {
  return request({
    url: '/student/roster',
    method: 'put',
    data: data
  })
}

// 删除学员
export function delRoster(id) {
  return request({
    url: '/student/roster/remove/' + id,
    method: 'delete',
    params: {}
  })
}

// 更新学习设置
export function updateSettings(data) {
  return request({
    url: '/student/roster/settings',
    method: 'put',
    data: data
  })
}

// 注册课程
export function registerCourse(data) {
  return request({
    url: '/student/roster/course',
    method: 'post',
    data: data
  })
}
